<template>
	<view class="order" v-if="Object.keys(datalist).length > 0">
		<view class="state">
			<u-steps :list="numList" :current="currentindex" mode="dot" active-color="#00BA3B"
				un-active-color="#CAD4DE"></u-steps>
		</view>
		<view class="message">
			<view class="title">订单信息</view>
			<view class="order_messge">
				<view>订单编号：<text>{{datalist.order_num}}</text></view>
				<view>创建时间：<text>{{datalist.create_date}}</text></view>
				<view>订单类型：<text>{{datalist.order_type}}</text></view>
				<view v-if="datalist.order_type=='招工订单'">
					<text>{{datalist.comp_name}}</text>
				</view>
				<view v-else>
					<text>{{datalist.comp_name}}</text>
				</view>
				<view style="display: flex;">工作内容：<text style="flex: 1;">{{datalist.work_type_name}}</text></view>
				<view>工作地址：<text>{{datalist.address}}</text></view>
			</view>
		</view>
		<view class="release">
			<view class="title">发布方信息</view>
			<view class="order_messge release_message">
				<view>发布人：<text>{{datalist.publish_user}}</text></view>
				<view>联系方式：<text>{{datalist.publish_mobile}}</text></view>
			</view>
		</view>
		<view class="release undertake">
			<view class="title">承接方信息</view>
			<view class="order_messge undertake_message">
				<view>承接人：<text>{{datalist.receiver}}</text></view>
				<view>联系方式：<text>{{datalist.receiver_mobile}}</text></view>
			</view>
		</view>
	</view>
</template>

<script>
	import api from '@/static/js/api.js'
	export default {
		data() {
			return {
				numList: [{
					name: '已创建'
				}, {
					name: '已确认'
				}, {
					name: '已完结'
				}],
				currentindex: null,
				personInfo: {},
				order_num: '', //订单编号
				datalist: {}
			}
		},
		onLoad(e) {
			this.personInfo = JSON.parse(uni.getStorageSync('userInfo'));
			this.currentindex = e.step
			this.order_num = e.order_num
			this.getdata()
		},
		methods: {
			getdata() {
				api.orderDetails('jhj.release.order.info', '_api_order_info_detail', this.personInfo.access_token, this
					.personInfo.uid, this.order_num).then(res => {
					this.datalist = res.data[0]
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.order {
		background: #F4F6F8;
		padding: 20rpx 30rpx;
		height: 100vh;
		overflow: hidden;

		>view {
			background: #fff;
		}

		.state {
			height: 120rpx;
			padding: 20rpx 0 0;
		}

		.message {
			min-height: 400rpx;
			margin-top: 30rpx;
			padding: 20rpx 30rpx;
			font-size: 28rpx;
		}

		.release {
			height: 230rpx;
			padding: 20rpx;
			margin-top: 20rpx;
			font-size: 28rpx;
		}

		.title {
			font-size: 32rpx;
			font-weight: bold;
			color: #333333;
			text-align: center;
			padding-bottom: 14rpx;
			border-bottom: 2rpx solid #E8E9EE;
		}

		.order_messge {
			line-height: 46rpx;
			padding: 20rpx 10rpx 0;

			text {
				color: #333333;
			}
		}
	}

	/deep/.u-steps__item__num {
	}

	/deep/.u-line-1 {
		font-size: 26rpx;
		font-weight: bold;
		color: #333333 !important;
	}
</style>
